#include <iostream>
#include <string>
using namespace std;

string sb(string s1,string s2){
    string::iterator it;
    it = s2.begin();
    while(it != s2.end()){
        if(*it == '"'){
            it = s2.erase(it);
        }else{
            it++;
        }
    }
    int j = 0;
    int flag = 0;
    
    for(int i = 0;i < s1.size();i++){
        
        if(s1[i] == '"'){
          
            if(flag == 0) flag = 1; 
            else if(flag == 1) flag = 0; 
          
            continue;
        }
        
        if(flag == 1){
           
            string s3;
            while(i < s1.size() && s1[i] != '"'){
                s3 += s1[i];
                i++;
            }
            
            if(s3 == s2) return "Ignore";
            flag = 0;
            continue;
        }
        
        if(flag == 0 && s1[i] != ','){
            string s3;
            while(i < s1.size() && s1[i] != ','){
                s3 += s1[i];
                i++;
            }
        
            if(s3 == s2) return "Ignore";
        }
    }

    return "Important!";
}

int main(){
    string s1,s2;
    while(getline(cin,s1) && getline(cin,s2)){
        string res = sb(s1,s2);
        cout<<res<<endl;
    }
    return 0;
}
